refactor: Rename the HTTPX extra and clients to httpx2 - #1048
Merged
Conversation
vdusek
force-pushed
the
refactor/rename-httpx-extra-to-httpx2
branch
from
September 2, 2026 13:57
659bb04 to
fcb9f76
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1048 +/- ##
=======================================
Coverage 95.27% 95.27%
=======================================
Files 59 59
Lines 5503 5503
=======================================
Hits 5243 5243
Misses 260 260
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pijukatel
approved these changes
Sep 3, 2026
vdusek
added a commit
to apify/apify-sdk-python
that referenced
this pull request
Sep 3, 2026
Updates the development lockfile to the current releases of our own dependencies, and fixes the docs shortcut generator that the new client broke. - `apify-client` 3.1.3 -> 3.2.0 - `crawlee` 1.9.3 -> 1.10.0, which pulls `impit` 0.13.2 -> 0.14.0 - `website/generate_module_shortcuts.py` now skips attributes that raise `ImportError` because an optional extra is missing. `apify-client` renamed its HTTPX extra to `httpx2` and guards the import (apify/apify-client-python#1048), so `inspect.getmembers` walking `apify_client.http_clients` raised `ImportError` and broke the docs build. `pyproject.toml` constraints are untouched - both new versions already satisfy them, so this only moves the lockfile used for development and CI. *✍️ Drafted by Claude Code*
vdusek
added a commit
that referenced
this pull request
Sep 8, 2026
`_httpx2.py` pulled the library in as `import httpx2 as httpx`, so the module and its tests read `httpx.*` throughout while the installed package is `httpx2`. Dropping the alias lets the code name the library it actually uses. The rename follows through: the private transport attributes become `_httpx2_client` and `_httpx2_async_client`, matching the sibling adapter's `_impit_client` / `_impit_async_client`, and 21 test functions plus the `UNSET_HTTPX2_TIMEOUT` constant lose the old spelling. All of it is private, so no public name moves. A search for the original `httpx` under `src/` and `tests/` now turns up only the two sentences that describe the library's lineage on purpose. It also cleans up link labels left over from #1048. Eight places wrote `[HTTPX](https://github.com/pydantic/httpx2)`, giving the current client the old library's name, and the surrounding prose had the same split: docstrings said HTTPX while the link beside them said HTTPX2. The library calls itself HTTPX2, so 66 prose references now use that name. The v2 upgrade guide is the reverse case: it describes moving off the original `httpx`, so its link goes back to python-httpx.org, matching what the 2.5 docs already say. These changes land in `docs/` only, so they reach the docs site at `/next` until the next version snapshot. No behavior changes. The 241 unit tests covering the HTTP clients, headers, timeouts, and the pluggable client still pass, 21 of them under new names. *✍️ Drafted by Claude Code*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renames the optional extra
httpxtohttpx2, andHttpxHttpClient/HttpxHttpClientAsynctoHttpx2HttpClient/Httpx2HttpClientAsync, along with the private module, the docs examples, and the test ids. Once httpx releases 1.0 with a new API, an extra namedhttpxthat installshttpx2would confuse users (see #1046 (comment)).Neither name has shipped in a stable release, so nothing is breaking. Kept as is: the
import httpx2 as httpxalias inside the module, "HTTPX" as the library name in prose, and the historical v2 upgrade note.Follows up on #1046.
✍️ Drafted by Claude Code